(function () {
    const as = document.querySelectorAll('.floor .one .first-a li a')
    const asb = document.querySelectorAll('.floor .one .first-b')
    for (let i = 0; i < as.length; i++) {
        as[i].addEventListener('mouseenter', function () {
            // console.log('点击');
            document.querySelector('.floor .one .style_red').classList.remove('style_red')
            this.classList.add('style_red')

            document.querySelector('.floor .one .active').classList.remove('active')
            asb[i].classList.add('active')

        })
    }
}());

(function () {
    const as = document.querySelectorAll('.floor .two .first-a li a')
    const asb = document.querySelectorAll('.floor .two .first-b')
    for (let i = 0; i < as.length; i++) {
        as[i].addEventListener('mouseenter', function () {
            // console.log('点击');
            document.querySelector('.floor .two .style_red').classList.remove('style_red')
            this.classList.add('style_red')

            document.querySelector('.floor .two .active').classList.remove('active')
            asb[i].classList.add('active')

        })
    }
}());

(function () {
    const as = document.querySelectorAll('.floor .three .first-a li a')
    const asb = document.querySelectorAll('.floor .three .first-b')
    for (let i = 0; i < as.length; i++) {
        as[i].addEventListener('mouseenter', function () {
            // console.log('点击');
            document.querySelector('.floor .three .style_red').classList.remove('style_red')
            this.classList.add('style_red')

            document.querySelector('.floor .three .active').classList.remove('active')
            asb[i].classList.add('active')

        })
    }
}());


const nav = document.querySelector('nav .dropdown')
const shortcut = document.querySelector('.shortcut')
window.addEventListener('scroll', function () {
    const n = document.documentElement.scrollTop
    if (n >= nav.offsetTop) {
        shortcut.style.top = '-10px'
    }
})



